import Views from "../../views/index.vue";
import type { RouteLocationNormalized, NavigationGuardNext } from "vue-router";

const route = [
    {
        path: "/echarts",
        name: "echarts",
        component: Views,
        redirect: "/echarts/echarts",
        meta: { title: "echarts", icon: "el-icon-table-lamp" },
        children: [
            {
                path: "echarts",
                name: "echarts-echarts",
                component: () => import("../../pages/echarts/index.vue"),
                meta: { title: "echarts" },
                beforeEnter: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
                    console.log("beforeEnter echarts page", { to, from });
                    next();
                },
            },
            {
                path: "echartsPie",
                name: "echarts-echartsPie",
                component: () => import("../../pages/echarts/indexPie.vue"),
                meta: { title: "echarts" },
                beforeEnter: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
                    console.log("beforeEnter echarts page", { to, from });
                    next();
                },
            },
            {
                path: "echartsScroll",
                name: "echarts-echartsScroll",
                component: () => import("../../pages/echarts/indexScroll.vue"),
                meta: { title: "echarts" },
                beforeEnter: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
                    console.log("beforeEnter echarts page", { to, from });
                    next();
                },
            },
            {
                path: "echartsTable",
                name: "echarts-echartsTable",
                component: () => import("../../pages/echarts/indexTable.vue"),
                meta: { title: "echarts" },
                beforeEnter: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
                    console.log("beforeEnter echarts page", { to, from });
                    next();
                },
            },
        ],
    },
];

export default route;
